package com.richard.base.starter

import com.facebook.drawee.backends.pipeline.Fresco
import com.richard.base.BaseApplication
import com.richard.base.util.FontsOverride
import com.wxy.appstartfaster.executor.TaskExceutorManager
import com.wxy.appstartfaster.task.AppStartTask
import java.util.concurrent.Executor

/**
 ***************************************
 * 项目名称:Giggle
 * @Author wuzhiguo
 * 邮箱：wuzhiguo@ksjgs.com
 * 创建时间: 2020/7/27     8:24 PM
 * 用途:
 ***************************************
 */
class InitFontTask: AppStartTask() {
    override fun run() {
        initFresco()
    }

    override fun isRunOnMainThread(): Boolean {
        return false
    }


    override fun runOnExecutor(): Executor {
        return TaskExceutorManager.getInstance().cpuThreadPoolExecutor
    }
    /**
     * 初始化字体
     */
    private fun initFresco() {
        FontsOverride.setDefaultFont(BaseApplication.instance, "MONOSPACE", "fonts/FZZJ-ZZGKTJW.TTF");
    }

}